$.each($('.nav a'), function(k, v){
    if(location.href.indexOf(v.getAttribute('href')) != -1){
        $('.nav a').removeClass('action');
        v.setAttribute('class', 'action');
    }
});